package com.lightjet.macross.base.awf.config;

import lombok.extern.java.Log;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author : lijia
 * @version : 1.0 2019-02-20 08:58
 * description :
 */
@Log
@Component("nodeDoneExecutionListener")
public class NodeDoneExecutionListener implements ExecutionListener {
    @Autowired
    RepositoryService repositoryService;

    @Override
    public void notify(DelegateExecution delegateExecution) {
        log.info("触发【"+delegateExecution.getCurrentFlowElement().getName()+"】nodeDoneExecutionListener"+delegateExecution.getId()+":"+delegateExecution.getProcessInstanceId());
        if(delegateExecution.getParent().isMultiInstanceRoot())
        {
            return;
        }
        if(delegateExecution.getVariable("signerList")!=null)
        {
            delegateExecution.setVariable("signerList",null);
        }
    }
}